<!doctype html>
<html>
 <head>
  <meta charset="UTF-8">
  <title>投票结果</title>
	<link rel="stylesheet" href="common.css">
	<link rel="stylesheet" href="result.css">
	<script src="lib/zepto.js"></script>
	<script src="common.js"></script>
	<script src="result.js"></script>
	<!-- <script src="codebase/dhtmlxchart.js"></script><link rel="stylesheet" type="text/css" href="codebase/dhtmlxchart.css"> -->
	<script src="lib/chart_js/Chart.bundle.min.js"></script>
    
	<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>

 </head>
 <body>

<!-- 返回按钮大法好，根据链接的来源判断是否显示 -->
<a style="display:none;" id="close-frame-button" class="highlight-btn" onclick="window.top.hideFrame();history.back();">返回</a>

<div id="poll-result" class="card-shape">
	<div class="poll-info">
		<h3 id="poll-title">加载中...</h3>
		<p class="poll-deadline"><em id="poll-deadline">即将</em>&nbsp;结束</p>
		<div class="poll-status" id="poll-status" style="z-index:5;"></div>
		<p class="total-number">投票总数：<em id="total-number"></em></p>
		<p class="poll-type">投票类型：<em id="poll-type"></em></p>
	</div>
	<div class="poll-options">
		<li id="model">
			<i class="checkbox checked"></i>
			<div class="front"></div>
			<span class="name">还有一个选项</span>
			<span class="number">20</span>
		</li>
		<ul id="option-list">
		</ul>
	</div>
	<div id="chart-section" data-chart-type="">
		<!-- <li><span class="color-block"></span></li> -->
		<div class="chart-wrap" id="bar-wrap">
			<table>
			<tr>
				<td class="legend-cell" valign="value"><ul class="chart-legend" id="chart-legend"></ul></td>
				<td class="canvas-cell" valign="value">
					<div id="canvas-wrap-bar">
						<canvas id="chart-canvas-bar" class="chart-canvas" height="200" width="200"></canvas>
						<a class="toggle-btn" onclick="toggleChartType('pie')">切换到饼状图</a>
					</div>
					<div id="canvas-wrap-pie">
						<canvas id="chart-canvas-pie" class="chart-canvas" height="200" width="200"></canvas>
						<a class="toggle-btn" onclick="toggleChartType('bar')">切换到条形图</a>
					</div>
				</td>
			</tr>
			</table>
		</div>
	</div>
</div>




<div id="poll-record" class="hidden">
	<div class="card-shape">
		<div class="option-info">
			<span class="close-btn" onclick="closeRecords()"></span>
			<h4>选项:&nbsp;<span class="option-name"></span></h4>
			<p class="total-num">共<span class="total-number"></span>人选择</p>
		</div>
		<div class="record-list">
		<li id="model-record">
			<div class="info">
				<p class="will">意愿:<span class="will-num">23</span></p>
			</div>
			<div class="avatar-wrap"><img class="avatar" src=""></img></div>
			<p class="nickname">NNNNN</p>
			<time class="time">132456789</time>
		</li>
		<ul id="record-ul"></ul>
		</div>
	</div>
</div>

<div id="view-forbidden" class="msgbox" style="display:none;">
	<div class="block">
		<h3>不可查看结果</h3>
		<p class="main">由于房主的设置，您不能查看此投票结果</p>
	</div>
</div>


<script>

/*** For test ***/
/*setData({
	'totalNum':299,
	'type':2,
	'is_over':1,
	'options':[
	{'content':'yigedf',checked:false,number:34,},
	{'content':'ywhfigedf',checked:true,number:78,},
	{'content':'ydfgedf',checked:false,number:3,},
	{'content':'yifvbgedf',checked:false,number:84,},
	{'content':'sdedf',checked:false,number:12,},
	{'content':'sdgedf',checked:false,number:9,},
	],
});
*/

/*{"item":{"item_id":"64","content":"\u542f\u660e\u65c1\u8fb9\u4e8c\u697c\u5496\u5561\u9986","room_id":"20"},"data":[{"nickname":"Everyblue","voter_img":"http:\/\/wx.qlogo.cn\/mmopen\/ajNVdqHZLLBSUsfdNCreluJicR17yicXzW1nhzE9GIWQznDy7Blk94lOtxrAY3WlVObHykibWhn428NhWbyhgeBKdoKrZg7oibbFpwXdKq7Yydo\/0","poll_persentage":6,"vote_time":"1479735614"},{"nickname":"Coordinate35","voter_img":"http:\/\/wx.qlogo.cn\/mmopen\/ibsqOu4Ku4jVp848tXvTRw80PQmaHKSwyDBNnCpSXcUNlNxiaFTD6cWj2UJW03KxKZ5eUIbv1md7iaXtnMLGC4Pl1D9CDiaRFbKR\/0","poll_persentage":26,"vote_time":"1479735727"},{"nickname":"\u7d20\u65b9\u683c\u5b50\u5a9b","voter_img":"http:\/\/wx.qlogo.cn\/mmopen\/ibsqOu4Ku4jUbDsAQKkFUGwj06WDPzaHBwW05elWbgTjFcwLJnps36d4OPfo6GfSibRM8jpwEjuyPbFLAgzLJd8JypkFLPuAeB\/0","poll_persentage":51,"vote_time":"1479737346"},{"nickname":"\u8d85\u7ea7\u5c0f\u725b","voter_img":"","poll_persentage":15,"vote_time":"1479739387"}]}*/


/*$('#poll-record').hide();*/

//setRecords({"item":{"item_id":"64","content":"\u542f\u660e\u65c1\u8fb9\u4e8c\u697c\u5496\u5561\u9986","room_id":"20"},"data":[{"nickname":"Everyblue","voter_img":"http:\/\/wx.qlogo.cn\/mmopen\/ajNVdqHZLLBSUsfdNCreluJicR17yicXzW1nhzE9GIWQznDy7Blk94lOtxrAY3WlVObHykibWhn428NhWbyhgeBKdoKrZg7oibbFpwXdKq7Yydo\/0","poll_persentage":6,"vote_time":"1479735614"},{"nickname":"NoBody","voter_img":"","poll_persentage":0,"vote_time":"145614"},{"nickname":"Coordinate35","voter_img":"http:\/\/wx.qlogo.cn\/mmopen\/ibsqOu4Ku4jVp848tXvTRw80PQmaHKSwyDBNnCpSXcUNlNxiaFTD6cWj2UJW03KxKZ5eUIbv1md7iaXtnMLGC4Pl1D9CDiaRFbKR\/0","poll_persentage":26,"vote_time":"1479735727"},{"nickname":"\u7d20\u65b9\u683c\u5b50\u5a9b","voter_img":"http:\/\/wx.qlogo.cn\/mmopen\/ibsqOu4Ku4jUbDsAQKkFUGwj06WDPzaHBwW05elWbgTjFcwLJnps36d4OPfo6GfSibRM8jpwEjuyPbFLAgzLJd8JypkFLPuAeB\/0","poll_persentage":51,"vote_time":"1479737346"},{"nickname":"\u8d85\u7ea7\u5c0f\u725b","voter_img":"","poll_persentage":15,"vote_time":"1479739387"}]});


/** Misc **/

//fetchData();
window.onhashchange = window.onload = function(){
	hideMainArea();
	closeRecords();
	if(pieChartObj && pieChartObj.destroy) pieChartObj.destroy();
	if(barChartObj && barChartObj.destroy) barChartObj.destroy();
	hideMsgBox();
	fetchData();
}

if(checkOpenFrom()){
	//document.getElementById('close-frame-button').style.display = 'block';
}else{
	//document.getElementById('close-frame-button').style.display = 'none';
}


//setData({"items":[{"item_id":"14","content":"\u597d","user_value":"0.5","total_value":0.5,"is_over":true},{"item_id":"15","content":"\u4e0d\u4e0d\u4e0d\u4e0d\u597d","user_value":"0.5","total_value":0.5,"is_over":true}],"is_viewable":true,"theme":"\u7f51\u5361","theme_description":"\u963f","end_time":"1479774256","room_type":"0",'is_viewable':true});
//setData({"items":[{"item_id":"94","content":"\u5b66\u973890+","user_value":"0.111111","total_value":0.111111,"is_over":true},{"item_id":"95","content":"\u51d1\u540870+","user_value":"0.888889","total_value":0.888889,"is_over":true},{"item_id":"96","content":"60\u521a\u521a\u597d","user_value":"0","total_value":0.3,"is_over":true},{"item_id":"97","content":"\u6302\u4e86","user_value":"0","total_value":1,"is_over":true}],"is_viewable":true,"theme":"\u590d\u53d8\u8003\u8bd5\u96be\u4e0d\u96be","theme_description":"\u6302\u79d1\u7387\uff1f","end_time":"1481102959","room_type":"2"});

</script>


<!-- CNZZ Status -->
<script src="http://s11.cnzz.com/stat.php?id=1261578070&web_id=1261578070" language="JavaScript"></script>


 </body>
</html>
